package familytree.yu.com.sso.controller;

import familytree.yu.com.adminclient.api.MemberInfoClientApiService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: yuyunbo
 * @Date: 2021/2/23 22:17
 * @Description:
 */
@RequestMapping("/user")
@RestController
public class UserController {

    @Resource
    private UserDetailsService userDetailsService;

    @RequestMapping("/hello")
    public Object hello(){
        return "hello";
    }

    @RequestMapping("/hellsdo")
    public Object hellsdo(){
        return "hello";
    }

    @RequestMapping("/getUserInfo")
    public Object getUserInfo(String userName){
      return  userDetailsService.loadUserByUsername(userName);
    }
}
